﻿@using Topro.Entity.Enum;
@{
    Layout = "~/Views/Shared/_Dialog.cshtml";
}
@model Topro.Entity.Response.IQS.IQSResponse
<section class="container-fluid" style="background-color: white;">
    <form class="form-horizontal m15_t" id="form">
        <div class="tab-content">
            <input type="hidden" id="Id" name="Id" value="@(Model.Id)">
            <div class="tab-pane fade in active" id="home">
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>配置编码：</label>
                    <div class="wd250 m15_l">
                        <input class="form-control" type="text" name="machineCode" maxlength="16" autocomplete="off" placeholder="配置编码" value="@(Model.MachineCode)">
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>设备编码：</label>
                    <div class="wd250 m15_l">
                        <input class="form-control" type="text" name="equipmentCode" maxlength="16" autocomplete="off" placeholder="设备编码" value="@(Model.EquipmentCode)">
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>厂号：</label>
                    <div class="wd250 m15_l">
                        <input class="form-control" type="text" name="plntNum" maxlength="16" autocomplete="off" placeholder="厂号" value="@(Model.PlntNum)">
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>批号：</label>
                    <div class="wd250 m15_l">
                        <input class="form-control" type="text" name="lotBatch" maxlength="16" autocomplete="off" placeholder="批号" value="@(Model.LotBatch)">
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>料号：</label>
                    <div class="wd250 m15_l">
                        <input class="form-control" type="text" name="partNum" maxlength="16" autocomplete="off" placeholder="料号" value="@(Model.PartNum)">
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>叠合次数号：</label>
                    <div class="wd250 m15_l">
                        <input class="form-control" type="text" name="heapNumber" maxlength="16" autocomplete="off" placeholder="叠合次数号" value="@(Model.HeapNumber)">
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>流程卡时间：</label>
                    <div class="wd250 m15_l">
                        <input class="form-control" type="text" name="travellerDate" maxlength="20" autocomplete="off" placeholder="流程卡时间" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="@(Model.TravellerDate.HasValue ? Model.TravellerDate.Value.ToString("yyyy-MM-dd HH:mm:ss"):"" )">
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>压合程式：</label>
                    <div class="wd250 m15_l">
                        <input class="form-control" type="text" name="pressProgram" maxlength="32" autocomplete="off" placeholder="压合程式" value="@(Model.PressProgram)">
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>材料时间：</label>
                    <div class="wd250 m15_l">
                        <input class="form-control" type="text" name="materialDate" maxlength="20" autocomplete="off" placeholder="材料时间" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="@(Model.MaterialDate.HasValue ? Model.MaterialDate.Value.ToString("yyyy-MM-dd HH:mm:ss"):"" )">
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>创建时间：</label>
                    <div class="wd250 m15_l">
                        <input class="form-control" type="text" name="createdDate" maxlength="20" autocomplete="off" placeholder="料号" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="@(Model.CreatedDate.ToString("yyyy-MM-dd HH:mm:ss"))">
                    </div>
                </div>
            </div>
        </div>
    </form>
</section>
@section footerScript{
    <script type="text/javascript">

        function save() {

            var cover = Topro.UI.Mask({
                obj: $("body"),
                opacity: 0.5
            });

            var data = $("#form").serializeJSON();

            //data.merchantId = $("select[name='merchantId']").find("option:selected").val();

            Topro.Util.Ajax({
                type: "POST",
                url: "/IQS/AdminSaveIQS",
                data: data,
                success: function (res) {
                    if (res.success) {
                        cover.Remove();
                        Topro.UI.DialogOpener().Tip_success("操作成功！");
                        Topro.UI.DialogOpener().doSearch();
                        Topro.UI.CloseDialog();
                    } else {
                        cover.Remove();
                        Topro.UI.Tip_short_warning("操作失败！" + res.message);
                    }
                },
                error: function (json) {
                    cover.Remove();
                    Topro.UI.Tip_warning("操作失败！请查看网络，请重试。");
                }
            });

        }
    </script>
}